<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <title>我的订单</title>

    <link rel="stylesheet" type="text/css" href="../../css/aui-win.css"/>
    <style>
        body{
            background:#E0E0E0;
        }
    	div{
    		width:100%;
    		/*background:#E0E0E0;*/
    		
    	}
    	span{
    		margin-top:200px;
    		font-size: 20px;
    	}
        /*头部样式*/
        #back{
            background: transparent;
        }
        /*显示隐藏的CSS*/
        .noMsg{ display: none; }
        .hasMsg{ display:block;}
        /*中间样式开始*/

        #jindu{
        	height: 30px;
        	width: 100%
        }
        #jindu div{
        	width: 33.3%;
        	height: 30px;
        	float: left;
        	text-align: center;
        	line-height: 30px;
        	color: #4c4c4c;
        	border-bottom: 2px solid white;
        	background: white;
        }
		#jindu div:hover{
			color: #00abfd;
			border-bottom: 2px solid #00abfd;
		}
        .current-active{
            color: #00abfd !important;
            border-bottom: 2px solid #00abfd !important;
        }
		#ListUl{
			width:100%;
			
		}
		#ListUl li{
			height: 162px;
			margin-top: 10px;
			width: 100%;
		}
		.li-top{
			width: 100%;
			height: 120px;
			background: white;
			
		}
        .li-top-img{
            margin: 10px;
            width: 100px;
            height: 100px;
            float: left;
        }
        .li-top-p{
            padding: 10px;
        }
        .li-top-p p{
            width: 90%;
            
        }
		.li-top-p{
			margin-left:110px;
		}
        .title{
            
            font-size:16px;
        }
        .goods-num{
        
            font-size:16px;
        }
		.li-bottom{
			width: 100%;
			margin-top: 1px;
			height: 41px;
			float:left;
		}
		.li-bottom .a1{
			width: 49.8%;
			height: 39px;
			float: left;
			background: white;
			line-height: 39px;
			color: #4c4c4c;
			text-align: center;
		}
		.li-bottom .a2{
			width: 49.9%;
			height: 39px;
			float: right;
			background: white;
			line-height: 39px;
			color: #4c4c4c;
			text-align: center;
		}
		.li-bottom a:hover{
			color: #00abfd;
			border-bottom: 2px solid #00abfd;
		}
		#tanchuceng_dingdan{
			width:80%;
			margin-left:10%;
			border-radius:2px;
			background:white;
			position:fixed;
			top:50%;
			z-index:555;
			display:none;
		}
		#zhezaoceng{
			width:100%;
			height:100%;
			background:black;
			position:fixed;
			top:0;
			left:0;
			opacity: 0.5;
			z-index:554;
			display:none;
		}
		#tanchuceng_dingdan a{
			float:right;
			width:15%;
			height:20px;
			line-height:20px;
			text-align:center;
			background:#d5d5d5;
			color:#888;
			font-size:10px;
			margin-top:5px;
			margin-right:3%;
			border-radius:7px;
		}
		#tanchuceng_dingdan img{
			float:left;
			width:50%;
			margin-left:25%;
			margin-top:30px;
		}
		.p1,.p2{
			float:left;
			width:100%;
			text-align:center;
			margin-top:10px;
		}
		h1{
			float:left;
			width:100%;
			text-align:center;
			margin-top:10px;
			color:#00abfd;
			font-size:25px;
		}
    </style>
</head>
<body>
    
    <header class="aui-bar aui-bar-nav aui-bar-yunzo" id="aui-header">
		<a class="aui-btn aui-bar-yunzo aui-pull-left" id="back" onclick="back_go()"> <span class="aui-iconfont aui-icon-left"></span></a>
		<div class="aui-title" id="title">
			我的订单
		</div>
		<a class="aui-iconfont aui-icon-menu aui-pull-right"></a>
	</header>
	<div class="margin_div"></div>
    <div id="jindu">
    	<div id="conduct" class="current-active" >进行中</div>
    	<div id="complete" >已完成</div>
    	<div id="void" >作废</div>
    </div>
	<ul id="ListUl">
		<!--<li>-->
			<!--<div class="li-top">-->
				<!--<img src="../i.png" alt="logo" class="li-top-img">-->
				<!--<div class="li-top-p">-->
					<!--<p class="title">淘宝天猫金属珠宝商务业休闲手表拍摄经典。。</p>-->
					<!--<p>-->
						<!--<strong>￥1000.0</strong>-->
						<!--<span class="goods-num">供1件商品</span>-->
					<!--</p>-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="li-bottom">-->
				<!--<a class="a1">删除订单</a>-->
				<!--<a class="a2">查看详情</a>-->
			<!--</div>-->
		<!--</li>-->
	</ul>
    <!--加载loading功能-->
    <div id="loadIng_startStop" style="width: 100%;height: 100%;position: absolute;z-index: 1000;display: none;">
    <div class="div_loding_img">
		数据加载中
		</div>
    </div>
    <div id="zhezaoceng">
    
    </div>
    <div id="tanchuceng_dingdan">
    	<a onclick="colod_()">关闭</a>
    	<img src="">
    	<h1></h1>
    	<p class="p1"></p>
    	<p class="p2"></p>
    </div>
</body>
<script type="text/javascript" src="../../script/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script>
	
	$("#tanchuceng_dingdan").height($("#tanchuceng_dingdan").width())
	$("#tanchuceng_dingdan").css("margin-top",-$("#tanchuceng_dingdan").width()/2)
    /*ty-2015-11-23*/
    var pagesize=5;
    var type =0;

    /*页面加载时就获取进行中列表*/
   $(document).ready(function(){
       jinxingzhong();
       
   	});

    function rec(){
        window.history.go(-1);
    }
    /*点击进行中订单*/
    $("#conduct").click(function(){
        console.log("ddd");
        jinxingzhong(0);
    });

    function jinxingzhong(){
        $("#jindu > div").attr("class","");
        $("#conduct").attr("class","current-active");
        showListInfo(0);
    }

    /*点击已完成订单*/
  $("#complete").click(function(){
    $("#jindu > div").attr("class","");
    $("#complete").attr("class","current-active");
      showListInfo(1);

});

    /*点击作废订单*/
    $("#void").click(function(){
        $("#jindu>div").attr("class","");
        $("#void").attr("class","current-active");
        showListInfo(2);
    });
    /*封装函数，根据type123值的不同*/
    function showListInfo(num){
        type = num;
        var bodyParam={
            type:type,
            pagesize:pagesize,
            mid:$mid,
            groupid:$groupid,
            did:initdata.get('myorder')
        };
        var srcc;
        ajaxcocRequest("../../../api/account/getmyorderlist","POST",bodyParam,function(msg){
            console.log(msg+" 666");
            var str="";
            if(msg.code==100){
                if(msg.data.length==0){
                	
                	if(type==1){
                    	$("#ListUl").html("<div style='width:20%;margin:40px 0 0 40%;'><img src='../../image/gantan.png' style='width:100%;'></div><p style='width:100%;text-align:center;margin-top:30px;color:#999;font-size:18px;'>暂时还没有完成的订单！</p>");
                	}
                	if(type==2){
                		$("#ListUl").html("<div style='width:20%;margin:40px 0 0 40%;'><img src='../../image/gantan.png' style='width:100%;'></div><p style='width:100%;text-align:center;margin-top:30px;color:#999;font-size:18px;'>暂时还没有作废的订单！</p>");
                	}
                	else{
                		$("#ListUl").html("<div style='width:20%;margin:40px 0 0 40%;'><img src='../../image/gantan.png' style='width:100%;'></div><p style='width:100%;text-align:center;margin-top:30px;color:#999;font-size:18px;'>暂时还没有完成订单！</p>");
                	}
                }
                else{
                    for(var j=0;j<msg.data.length;j++){
                    	if(msg.data[j].n1==""){
                    		srcc="../../image/defaultImg2.png"
                    	}
                    	else{
                    		srcc=msg.data[j].n1
                    	}
                        str += "<li>";
                        str += "<img src='"+srcc+"' alt='logo' class='li-top-img'>";
                        str += "<div class='li-top-p'><p class='title'>名称："+msg.data[j].n2+"</p>";
                        str += "<p style='color:black;'><span class='goods-num'>联系人:"+msg.data[j].n5+"</span></p><p>联系人电话："+msg.data[j].n6+"</p></div>";
                        str +="<div class='li-bottom'><a class='a1' onclick='rec_c(\"" + msg.data[j].n0 + "\")'>删除订单</a><a class='a2'  onclick='selec_c(\"" + msg.data[j].n5 + "\",\"" + msg.data[j].n6 + "\",\"" + msg.data[j].n2 + "\",\"" + srcc + "\")'>查看详情</a></div></li>";
                    }
                    $("#ListUl").html(str);
                }
            }
            else{
            	$("body").append('<div class="wuwang"><img src="../../image/iconfont-wangluo.png"><p>网络拥堵，信息塞车</p></div>')
            }
        });
        console.log(555);
    }
    /*loading加载转圈*/
    sTart_Stop();
  function rec_c(oids){
     if(confirm( '确定是否真的删除信息?'))
	{
    	var postt={
    		mid:$mid,
            groupid:$groupid,
            did:initdata.get('myorder'),
            oids:oids
    	};
    	ajaxcocRequest("../../../api/account/delmyorderinfobyid","POST",postt,function(msg){
            if(msg.code==100){
            	alert("删除成功！")
            	window.history.go(0)
            	
            }
            else{
            	$(body).append('<div class="wuwang"><img src="../image/iconfont-wangluo.png"><p>网络拥堵，信息塞车</p></div>')
            }
    	});
	}
    }
function selec_c(name,tel,inf,log){
	$("#tanchuceng_dingdan").css("display","block");
	$("#zhezaoceng").css("display","block");
	$("#tanchuceng_dingdan img").attr("src",log);	
	$("#tanchuceng_dingdan h1").html("名称："+inf);
	$(".p1").html("联系人："+name);
	$(".p2").html("电话："+tel);
  }
  function colod_(){
		$("#tanchuceng_dingdan").css("display","none");
		$("#zhezaoceng").css("display","none");
	}
</script>
</html>